package com.fable.ntzw_ga.entity;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 消息类：
 * @author Created by gzh on 2023/3/20 19:00
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(appliesTo = "chat_msg",comment="用户反馈问题表")
@Accessors(chain = true)
public class ChatMsg implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value = "问题id")
    @Column(name = "id", columnDefinition = "varchar(32) COMMENT '问题id'")
    private String id;
    /**
     *来自发送的username
     */
    @ApiModelProperty(value = "发送者用户名称")
    @Column(name = "from_username", columnDefinition = "varchar(32) NOT NULL COMMENT '发送者用户名称'")
    private String fromUsername;
    /**
     *接收者
     */
    @ApiModelProperty(value = "接收者用户名称")
    @Column(name = "to_username", columnDefinition = "varchar(32) NOT NULL COMMENT '接收者用户名称'")
    private String toUsername;
    /**
     *内容
     */
    @ApiModelProperty(value = "发送内容")
    @Column(name = "content", columnDefinition = "varchar(255) NOT NULL COMMENT '发送内容'")
    private String content;
    /**
     *时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "created", columnDefinition = "datetime(0) COMMENT '创建时间'")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime created;
    /**
     *左右两边对话框
     */
    @ApiModelProperty(value = "左右两边对话框")
    @Column(name = "dir", columnDefinition = "varchar(10)  COMMENT '左右两边对话框'")
    private String dir;
    /**
     *昵称
     */
    @ApiModelProperty(value = "昵称")
    @Column(name = "from_nickname", columnDefinition = "varchar(32)  COMMENT '昵称'")
    private String fromNickname;
    /**
     *处理状态(true处理过，false未处理)
     */
    @ApiModelProperty(value = "true处理过，false未处理")
    @Column(name = "status", columnDefinition = "tinyint(0) COMMENT 'true处理过，false未处理'")
    private boolean status = false;
}
